package com.gang.mars.basic.function;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;

/**
 * @author gang.chen
 * @description
 * @Date 2021/7/19 13:20
 */
public class Peach11 {
    String name;

    public static void main(String[] args) {
        Peach11 peach11 = new Peach11("gang.chen");
        System.out.println(peach11.sayHello("helloWorld..."));
    }

    <T extends Map<String,Object>> T asMap(Function<Peach11,T> function){
        T map = function.apply(this);
        return map;
    }

    public String sayHello(String something){
        Peach12 peach12 = asMap(peach11 -> new Peach12(peach11.getName()));
        String word = peach12.getName()+" "+something;
        return word;
    }

    public Peach11(){

    }

    public Peach11(String name){
        this.name = name;
    }

    public String getName() {
        return this.name;
    }




}
